package com.tuling.api.service;

import com.tuling.api.entity.ApiToken;
import com.tuling.api.entity.ApiTokenExample;
import com.tuling.api.mapper.ApiTokenMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author: xl
 * time: 2018/12/10 19:05
 * description:
 **/
@Service
public class TokenServiceImpl  implements  TokenService{


    @Autowired
    ApiTokenMapper apiTokenMapper;

    @Override
    public ApiToken getToken(String apiToken) {
        ApiTokenExample example = new ApiTokenExample();
        List<ApiToken> selectByExample = apiTokenMapper.selectByExample(example);
        if(selectByExample!=null && selectByExample.size()>0){
            return selectByExample.get(0);
        }
        return null;
    }
}
